<?php
	require_once "include/User.php";
	require_once "include/Template.php";
	
	$page = new Template();
	session_start();
	$page->setUser($_SESSION['user']);
	
	// Seeing if any error messages need to be included
	if      ($_GET['err'] == "empty")
		$page->addContentFromFile("include/html/status/emptyfields.html");
	else if ($_GET['err'] == "pwmismatch")
		$page->addContentFromFile("include/html/status/pwmismatch.html");
	else if ($_GET['err'] == "exists")
		$page->addContentFromFile("include/html/status/userexists.html");
	
	if      ($_GET['stat'] == null)
		;
	else if ($_GET['stat'] == "loggedin")
		$page->addContentFromFile("include/html/status/loggedin.html");
	
	// Determing which form to include
	if      ($_GET['act'] == null && $_SESSION['user']->loggedIn == false)
		$page->addContentFromFile("include/html/form_login.html");
	else if ($_GET['act'] == "register")
		$page->addContentFromFile("include/html/form_register.html");
	
	echo $page->getHTML();
?>
